package com.recipedb.recipedb.repository;

import com.recipedb.recipedb.entity.RecipeComment;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface RecipeCommentRepository extends JpaRepository<RecipeComment, Long> {
    // 根据食谱ID查询所有评论（按创建时间倒序，最新的在前）
    List<RecipeComment> findByRecipeIdOrderByCreatedAtDesc(Long recipeId);
}
